<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="org.simon.myauctioneer.dto.User"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>myauctioneer</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="container">
  <div id="header"><h1>myauctioneer</h1></div>
  <div id="search">
  	<form action="search" method="get">
        <table>
            <tr>
                <td><input type="text" name="search_field" id="search_field" value="full text search" /></td>
                <td>
                	<select name="search_category" size="1">
                      <option>all</option>
                      <option>smartphone</option>
                      <option>notebook</option>
                      <option>tablet</option>
                    </select>
                </td>
                <td>
                  <label>
                  <input type="radio" name="search_condition" value="new" id="search_condition_new" />
                    new</label>
                  <label>
                    <input type="radio" name="search_condition" value="used" id="search_condition_used" />
                    used</label></td>
                    <td><input name="search_button" type="button" id="search_button" value="Search" /></td>
            </tr>
        </table>
    </form>
  </div>
<div id="content">
	<h1>Welcome here</h1>
	<p>...</p>
</div>
  <div id="navi">
  	<%
  	if (session.getAttribute("user") == null) {
  		out.println("<form action=\"login\" method=\"post\">");
  		out.println("<table>");
  		out.println("<tr>");
  		out.println("<td><label for=\"email\">E-Mail</label><br /><input type=\"text\" name=\"email\" id=\"email\" /></td>");
  		out.println("</tr>");
  		out.println("<tr>");
  		out.println("<td><label for=\"password\">Password</label><br /><input type=\"password\" name=\"password\" id=\"password\" /></td>");
  		out.println("</tr>");
  		out.println("<tr>");
  		out.println("<td><input type=\"submit\" value=\"Login\" class=\"button\" /></td>");
  		out.println("</tr>");
  		out.println("</table>");
  		out.println("</form>");
  		out.println("<p><a href=\"register.jsp\">Register now</a></p>");
  	} else {
  		User user = (User) session.getAttribute("user");
  		out.println("<ul>");
  		out.println("<li><a href=\"showArticles\">My articles</a></li>");
  		out.println("<li><a href=\"logout\">Logout</a></li>");
  		out.println("</ul>");
  		out.println("<p>Eingeloggt als: <em>" + user.getName() + "</em></p>");
  	}
  	%>
  </div>
  <div id="footer">Copyright &copy; 2011 myauctioneer</div>
</div>
</body>
</html>
